<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<dev xmlns="http://www.w3.org/1999/xhtml"
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:c="http://java.sun.com/jsp/jstl/core"
     xmlns:f="http://java.sun.com/jsf/core"
     xmlns:p="http://primefaces.org/ui">
    <h:head>
        <ui:composition>
            <div class="div-header"> 
                <c:set var="root" value="#{request.contextPath}" />

                <div  class="div-login">
                    <div class="div-test">
                        <h:panelGrid  id="liscart" columns="3" style="min-width: 100px;;background: #000; float: right;" > 
                            <p:panel id="tdlogin" style="background: #000;border: #000;"  >


                                <p:dialog header="Gio Hang" hideEffect="fade" modal="true"  widgetVar="shoping"  >

                                    <p:dataTable value="#{cartController.card.listPromodel}" var="cart" >
                                        <p:column style="text-align: center;" headerText="Image">
                                            <p:graphicImage value="/resources/img/#{cart.prodetail.image}" style="padding: 0px auto !important;width: 70px;height: 80px;;"/>
                                        </p:column>
                                        <p:column  headerText="Tên Sản Phẩm">
                                            <h:outputText value="#{cart.prodetail.product.name}"/>
                                        </p:column>
                                        <p:column headerText="Đơn giá">
                                            <h:outputText value="#{cart.prodetail.price}"/>
                                        </p:column>
                                        <p:column  headerText="Số lượng">
                                            <h:outputText value="#{cart.soluong}"/>
                                        </p:column>

                                    </p:dataTable>
                                    <div style="width: 100%;padding: 10px;">
                                        <h:outputText value="Tổng: #{cartController.card.sumprice}" style="font-size: 17px;color: #f00;font-weight: bold;float: right;">
                                            <f:convertNumber pattern="#000,000VNĐ" />
                                        </h:outputText>
                                        <p:commandButton style="float: left;" action="cart" value="Xem chi tiết"/>


                                    </div>


                                </p:dialog> 
                                <span>
                                    |
                                </span>
                                <h:outputText id="test" value="Hello #{cusController.cus.fullName} " rendered="#{cusController.islogin()}" styleClass="loginlink"   />
                                <p:growl id="show_message" showDetail="true"  life="300"/>

                                <p:commandLink  value="Login" id="btnlogin"  onclick="overlay.show();"  rendered="#{!cusController.islogin()}" styleClass="loginlink" />
                                <span>
                                    |
                                </span>
                                <!--                            update="tdlogin,:form:listproduct"-->
                                <p:commandLink value="Logout" process="@all" update="tdlogin,listproduct"  action="#{cusController.logout()}" rendered="#{cusController.islogin()}" styleClass="loginlink" />
                                <p:commandLink value="Register" styleClass="loginlink" action="register" rendered="#{!cusController.islogin()}"/> 
                                <p:commandLink onclick="shoping.show()" >
                                    <p:graphicImage url="/resources/img/sp.png" style="cursor: pointer; border: 0px;width: 35px;height: 35px;padding-bottom: 0px;"/>
                                </p:commandLink>

                                <span class="span-shoping">
                                    <h:outputText value="#{cartController.count}"  >
                                        <f:converter converterId="javax.faces.Integer"/>
                                    </h:outputText>
                                </span>
                                <p:dialog header="User Login" hideEffect="fade" modal="true"  widgetVar="overlay" >
                                    <h:outputText value="UserName "/>
                                    <p:inputText value="#{cusController.cus.id}"/> 
                                    <br/>  
                                    <h:outputText  value="PassWord "/> 
                                    <p:password  value="#{cusController.cus.password}"/>  
                                    <br/> 
                                    <p:commandButton value="Login" process="@all"  action="#{cusController.login()}" update="tdlogin,listproduct" oncomplete="overlay.hide();"  />
                                </p:dialog> 

                            </p:panel>

                        </h:panelGrid>
                    </div>
                </div>
                <div style="margin: 0px auto;text-align: center;width: 1200px;padding: 2px;">
                    <p:imageSwitch effect="zoom">  
                        <ui:repeat value="#{cartController.images}" var="image"> 
                            <p:graphicImage style="z-index: 100;width: 1200px;height:200px;" value="/resources/img/#{image}"/>

                        </ui:repeat>  
                    </p:imageSwitch>

                </div>
                <div  >  
                    <div style="width: 1200px;margin: 0px auto;">

                        <p:menubar >
                            <p:menuitem styleClass="menuItem"  value="09Hutech.vn" action="#{productController.getpronew()}" update="listproduct" />
                            <p:menuitem styleClass="menuItem" value="Contact"/>
                            <p:menuitem styleClass="menuItem" value="Map"/>
                            <p:menuitem styleClass="menuItem" value="News"/>
                            <p:menuitem styleClass="menuItem" value="About 09Hutech"/>
                            <f:facet name="options">  
                                <p:inputText value="#{searchController.query}"/>
                                <p:splitButton id="splitbtn" value="Search By #{searchController.btnName}" action="#{searchController.search()}" >  
                                    <p:menuitem value="Search by Product" action="#{searchController.changName('product')}" update="splitbtn"/>
                                    <p:menuitem value="Search by Category" action="#{searchController.changName('catelogy')}" update="splitbtn"/>
                                     <p:menuitem value="Search by ProductType" action="#{searchController.changName('aa')}" update="splitbtn"/>
                                </p:splitButton>  
                            </f:facet>  
                        </p:menubar> 
                    </div>
                </div>
            </div>
        </ui:composition>
    </h:head>
</dev>